package com.laicunba.service.jzh;

import java.util.List;

import com.laicunba.pojo.JzhRechargeOrderDO;
import com.laicunba.pojo.JzhWithdrawDO;
import com.laicunba.service.BaseService;
import com.laicunba.service.jzh.JzhWithdrawService.BackParam;
import com.laicunba.service.jzh.JzhWithdrawService.Result;

public interface JzhWithdrawService extends BaseService {
	public class Param {
		private String uid;
		private int centAmt; // 分
		private String pageNotifyUrl = "";
		private String backNotifyUrl = "";
		private long seq;

		public void setSeq(long seq) {
			this.seq = seq;
		}

		public long getSeq() {
			return seq;
		}

		public void setUid(String uid) {
			this.uid = uid;
		}

		public String getUid() {
			return uid;
		}

		public int getCentAmt() {
			return centAmt;
		}

		public void setCentAmt(int centAmt) {
			this.centAmt = centAmt;
		}

		public String getPageNotifyUrl() {
			return pageNotifyUrl;
		}

		public void setPageNotifyUrl(String pageNotifyUrl) {
			this.pageNotifyUrl = pageNotifyUrl;
		}

		public String getBackNotifyUrl() {
			return backNotifyUrl;
		}

		public void setBackNotifyUrl(String backNotifyUrl) {
			this.backNotifyUrl = backNotifyUrl;
		}

	}

	public class ApplyResult {
		private String mchntTxnSsn;
		private String signature;
		private String loginId;

		public void setLoginId(String loginId) {
			this.loginId = loginId;
		}

		public String getLoginId() {
			return loginId;
		}

		public String getMchntTxnSsn() {
			return mchntTxnSsn;
		}

		public void setMchntTxnSsn(String mchntTxnSsn) {
			this.mchntTxnSsn = mchntTxnSsn;
		}

		public String getSignature() {
			return signature;
		}

		public void setSignature(String signature) {
			this.signature = signature;
		}

	}

	public class Result {
		private String respCode;
		private String respDesc;
		private String mchntTxnSsn;
		private String loginId;
		private int centAmt;
		private String signature;
		private String mchntCd;

		public String getMchntCd() {
			return mchntCd;
		}

		public void setMchntCd(String mchntCd) {
			this.mchntCd = mchntCd;
		}

		public String getRespCode() {
			return respCode;
		}

		public void setRespCode(String respCode) {
			this.respCode = respCode;
		}

		public String getRespDesc() {
			return respDesc;
		}

		public void setRespDesc(String respDesc) {
			this.respDesc = respDesc;
		}

		public String getMchntTxnSsn() {
			return mchntTxnSsn;
		}

		public void setMchntTxnSsn(String mchntTxnSsn) {
			this.mchntTxnSsn = mchntTxnSsn;
		}

		public String getLoginId() {
			return loginId;
		}

		public void setLoginId(String loginId) {
			this.loginId = loginId;
		}

		public int getCentAmt() {
			return centAmt;
		}

		public void setCentAmt(int centAmt) {
			this.centAmt = centAmt;
		}

		public String getSignature() {
			return signature;
		}

		public void setSignature(String signature) {
			this.signature = signature;
		}

	}

	public ApplyResult createApply(Param param);

	public boolean verifyFromJzhServer(Result result);

	public boolean onPayoutSuccess(Result result);

	public boolean onPayoutSuccessAccounting(JzhWithdrawDO withdrawDO);
	
	public class BackParam{
		private String respCode;
		private String mchntCd;
		private String mchntTxnSsn;
		public String getRespCode() {
			return respCode;
		}
		public void setRespCode(String respCode) {
			this.respCode = respCode;
		}
		public String getMchntCd() {
			return mchntCd;
		}
		public void setMchntCd(String mchntCd) {
			this.mchntCd = mchntCd;
		}
		public String getMchntTxnSsn() {
			return mchntTxnSsn;
		}
		public void setMchntTxnSsn(String mchntTxnSsn) {
			this.mchntTxnSsn = mchntTxnSsn;
		} 
		
	}

	public String makeEchoInfo(BackParam backParam);
	
	public List<JzhWithdrawDO> findJzhWithdrawList(String userId, int limit, int offset);
}
